//
//  PurchaseContactCell.swift
//  HuaYun
//
//  Created by enghou on 2018/8/30.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

import UIKit

class PurchaseContactCell: UITableViewCell {

    var _model: JSON?
    
    var model: JSON?{
        set{
            _model = newValue
            purchaseNameLabel.text = _model?.contents?["taskName"]?.rawString()
            let type = _model?.contents?["type"]?.rawString() ?? ""
            switch type {
            case "serviceEngineering":
                typeLabel.text = "服务"
            case "humanResources":
                typeLabel.text = "人力"
            case "engineering":
                typeLabel.text = "工程"
            case "material":
                typeLabel.text = "物资"
            default:
                typeLabel.text = "未知"
            }
            departmentLabel.text = _model?.contents?["projectDept"]?.rawString()
        }
        get{
            return _model
        }
    }
    
    
    @IBOutlet weak var purchaseNameLabel: UILabel!
    
    @IBOutlet weak var typeLabel: UILabel!
    
    @IBOutlet weak var departmentLabel: UILabel!
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
